import { createRouter, createWebHistory } from 'vue-router';
const routes = [
    {
    path:'/login',
    name:'Login',
    component:() => import("@/views/Login.vue"),
  },
    {
    path: "/:pathMatch(.*)",
    name: "NotFound",
    component: () => import("@/views/404.vue"),
  },
    {
    path:'/register',
    name:'Register',
    component:()=>import ("@/views/Register.vue"),
  },

    {
        path:'/uploadFiles',
        name:'aasdf',
        component:()=>import ("@/views/Upload.vue"),
    },
    {
        path:'/test',
        name:'Test',
        component:()=>import("@/views/test.vue"),
    },
    {
    path:'/newRepo',
    name:'NewRepo',
    component:()=>import ("@/views/NewRepo.vue"),
  },
    {
    path:'/search/:content?/:mode?',
    name:'searchView',
    component:()=>import ("@/views/searchView"),
  },
    {
    path:'/:userName/:repoName/tree/master',
    name:'Repository',
    component:()=>import ("@/views/repo/RepoHomeView"),
        children:[
            {
                path:'/:userName/:repoName/tree/master/:a1/:a2',
                name:'fgd',
                component:()=>import ("@/views/repo/DisplayFolder.vue"),
            },
            {
                path:'/:userName/:repoName/tree/master/:a1/:a2/:a3',
                name:'ayFoqwelder',
                component:()=>import ("@/views/repo/DisplayFolder"),
            },
            {
                path:'/:userName/:repoName/tree/master/:a1/:a2/:a3/:a4',
                name:'yFolder',
                component:()=>import ("@/views/repo/DisplayFolder"),
            },
            {
                path:'/:userName/:repoName/tree/master/:a1/:a2/:a3/:a4/:a5',
                name:'Folweder',
                component:()=>import ("@/views/repo/DisplayFolder"),
            },
            {
                path:'/:userName/:repoName/tree/master/:a1/:a2/:a3/:a4/:a5/:a6',
                name:'Fsdfdqweer',
                component:()=>import ("@/views/repo/DisplayFolder"),
            },
            {
                path:'/:userName/:repoName/tree/master/:a1/:a2/:a3/:a4/:a5/:a6/:a8',
                name:'Fsdfder',
                component:()=>import ("@/views/repo/DisplayFolder"),
            },
            {
                path:'/:userName/:repoName/issues/:issueId',
                name:'issue',
                component:()=>import ("@/views/Issue"),
            },
            {
                path:'/:userName/:repoName/releases/new',
                name:'Release',
                component:()=>import ("@/views/newRelease"),
            },
            {
                path: '/:userName/:repoName/issues',
                name: 'RepoIssuesView',
                component: ()=>import("@/views/repo/IssueView"),
            },
            {
                path:'/:userName/:repoName/releases/new',
                name:'NewRelease',
                component:()=>import ("@/views/newRelease"),
            },
            {
                path: '/:userName/:repoName/issues/createissue',
                name: 'CreateIssuesView',
                component: ()=>import("@/views/repo/CreatIssue"),
            },
            {
                path: '/:userName/:repoName/pulls/createpull',
                name: 'CreatePullsView',
                component: ()=>import("@/views/repo/CreatPull"),
            },
            {
                path: '/:userName/:repoName/',
                name: 'FolderView',
                component: ()=>import("@/views/repo/DisplayFolder"),
            },
            {
                path: '/:userName/:repoName/pulls',
                name: 'RepoPullsView',
                component: ()=>import("@/views/repo/PullView"),
            },
            {
                path: '/:userName/:repoName/manage',
                name: 'ManageView',
                component: ()=>import("@/views/repo/Manage"),
            },

            {
                path:'/:userName/:repoName/tree/master',
                name:'older',
                component:()=>import ("@/views/repo/DisplayFolder"),
            },
            {
                path:'/:userName/:repoName/branches',
                name:'Branches',
                component:()=>import ("@/views/Branches"),
            },
            {
                path:'/:userName/:repoName/tree/master/:a1',
                name:'lolder',
                component:()=>import ("@/views/repo/DisplayFolder"),

            },

            {
                path:'/:userName/:repoName/code/master',
                name:'layFolder',
                component:()=>import ("@/views/codeCount"),
            },

            {
                path:'/:userName/:repoName/pulls/:prId',
                name:'Folder',
                component:()=>import ("@/views/Pr"),
            },
            {
                path:'/:userName/:repoName/releases',
                name:'Release',
                component:()=>import ("@/views/repo/releaseView"),
            }
        ]
  },
    {
    path:'/',
    name:'home',
    component:()=>import ("@/views/HomeView"),
  },
  {
    path: '/:userName/',
    name:'User',
    component:()=>import("@/views/UserLayout"),
    children:[
      {
        path: '/:userName/',
        name: 'UserHomeView',
        component: ()=>import("@/views/user/UserHomeView"),
      },
      {
        path: '/:userName/pulls',
        name: 'PullsView',
        component: ()=>import("@/views/user/PullView"),
      },
      {
        path: '/:userName/issues',
        name: 'IssuesView',
        component: ()=>import("@/views/user/IssueView"),
      }
      ]

  },

]
 const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
